.clearfix::after {
    content: "";
    display: block;
    clear: both;
}



.header {

    height: 500px;

}

.header .topnav {
    position: fixed;
    width: 100%;
    background-color: lightblue;
    color: #999;
    text-align: center;
}

.header .topnav>li {
    float: left;
    box-sizing: border-box;
    color: #999;
    width: 150px;
    height: 40px;
    margin: 0 10px;
    line-height: 40px;
    display: block;
    position: relative;
}


.header .topnav>li:hover {
    background-color: blue;
    color: #fff;
    border: 1px solid black;
    border-bottom: none;
    line-height: 39px;

}

.header .topnav>li:hover::after {
    content: "";
    display: block;
    height: 1px;
    width: 150px;
    background-color: #fff;
    position: absolute;
    bottom: -1px;
}

.header .topnav>li:hover .subnav {
    display: block;
}

.header .topnav .subnav {
    width: 302px;
    background-color: #008c8c;
    border: 1px solid black;
    box-sizing: border-box;
    position: absolute;
    display: none;
    right: -1px;
}

.header .topnav .subnav li {
    float: left;
    box-sizing: border-box;
    width: 150px;
    line-height: 1.5;
}

.header .topnav .subnav li a {
    display: block;
}

.header .topnav .subnav li a:hover {
    background-color: red;
    color: black;
}